﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Pages_database : System.Web.UI.Page
{
    private SqlConnection conn;
    private SqlDataReader dr;
    private SqlCommand com;

    private const string sql_string = "Server=FRANKNOTEBOOK; DataBase=BakaLogie; Integrated Security=true; Connect Timeout=5;";
    
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    private void verbinding()
    {
        using (SqlConnection connection = new SqlConnection(sql_string))
        using (SqlCommand command = new SqlCommand("select * from [user];", connection))
        {
            connection.Open();
            info.DataSource = command.ExecuteReader(
              CommandBehavior.CloseConnection |
              CommandBehavior.SingleResult);
            info.DataBind();
        }
    }
    




    protected void Button1_Click(object sender, EventArgs e)
    {
        verbinding();
    }
    protected void dgrAllNames_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
}
